package interactables;

import java.util.ArrayList;

import game.Game;
import game.InputHandler;

public abstract class Tab {
	
	protected InputHandler input;
	protected Game game;
	protected String name;
	protected int id;
	
	protected ArrayList<Button> buttons = new ArrayList<Button>();
	
	public Tab(InputHandler input, Game game, String name, int id) {
		
		this.input = input;
		this.game = game;
		this.name = name;
		this.id = id;
	
		game.updateTabList(this);
		
	}
	
	public abstract void update();
	
	public String toString() {
		
		String buttonString = " ";
		
		for (Button b : buttons) {
			buttonString = buttonString + b.toString() + ", ";
		}
		
		buttonString = buttonString.substring(0, buttonString.length()-2);
		
		return "Name: " + name + ", ID: " + id + ", Buttons: "+ buttonString;
	
	}
	
	public void updateButtonList(Button b) {
		buttons.add(b);
	}
	
	public ArrayList<Button> getButtons() {
		return buttons;
	}
	
}
